package router

import (
	jwt "gitee.com/sansaniot/ssiot-core/httpmvc/jwtauth"
	"github.com/gin-gonic/gin"

	"ssdevice/internal/device/apis"
)

func init() {
	RouterCheckRole = append(RouterCheckRole, registerProfileRouter)
}

func registerProfileRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	api := apis.Profile{}
	r := v1.Group("/api/profile").Use(authMiddleware.MiddlewareFuncWithOutValidate())
	{
		r.GET("/get", api.FindDevProfile)
		r.POST("/save", api.UpsertEntireConfig)
		r.POST("/merge", api.MergeModifyConfig)
	}
}
